const path = require('path')
const webpack = require('webpack');
console.log('__dirname',__dirname);
console.log('path',path.join(__dirname, 'build'))
module.exports = {
    entry: {
        //依赖的库数组
        vendor: ['react', 'react-dom', 'react-loadable', 'react-redux', 'react-router-dom', 'redux', 'redux-saga']
    },
    output: {
        path: path.join(__dirname, 'build'),
        filename: '[name].js',
        library: '[name]_[hash]'
    },
    plugins: [
        new webpack.DllPlugin({
            //DllPlugin的name属性需要和library保持一致
            name:'[name]_[hash]',
            path:path.join(__dirname,'build','mainfest.json'),
            context:__dirname
        })
    ]
}